package System;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import junit.framework.TestCase;
/**
 * this is a junit test class for the classifier class
 * @author oz
 *
 */
public class testClassifier extends TestCase {
	Classifier clasi=new Classifier();
	
	public void testing() throws Exception {  
		File f = new File("");
        String go=new String(f.getAbsolutePath());
        System.out.println(go);
		String path=new String(go+"/logics/");
		System.out.println(clasi.setAlgorithm("ClasifyBySize"));
	    BufferedReader br;
		br = new BufferedReader(new FileReader(path+"logics_default.txt"));
	    String st;
      	if((st=br.readLine())!=null){
			  assertTrue(st.compareTo("ClasifyBySize")==0);
		}
      String[]tags="home@workspase@logics".split("@");
      File fi=new File("/home/ozreut/workspace/j2/1/logics/ClasifyByPath.class");
	clasi.insertTagToFile(tags,fi);
	//clasi.insertTagToFile(tags,f );
	clasi.changeTagsToFile(fi, "workspace", "work");
	
	clasi.deleteTagToFile(fi);
	f=new File("/home/ozreut/workspace/j2/1/logics/ClasifyBySize.class");
	tags=clasi.getTags(fi);
	assertTrue(tags[0].compareTo("small")==0);
        
  }
 
}
